{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "32de52d8",
   "metadata": {},
   "source": [
    "### 1.构图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "cb2423b9",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import pandas as pd\n",
    "import networkx as nx\n",
    "from matplotlib.font_manager import FontProperties\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "f01649aa",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv(r'F:\\work\\2023.10.09DK链路预测\\1原始数据.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "86789592",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Source</th>\n",
       "      <th>Target</th>\n",
       "      <th>weight</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>B20</td>\n",
       "      <td>A5</td>\n",
       "      <td>54.828015</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>B5</td>\n",
       "      <td>A11</td>\n",
       "      <td>53.200717</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>B26</td>\n",
       "      <td>A11</td>\n",
       "      <td>46.888787</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>B0</td>\n",
       "      <td>A0</td>\n",
       "      <td>38.183026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>B18</td>\n",
       "      <td>A0</td>\n",
       "      <td>37.556255</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Source Target     weight\n",
       "0    B20     A5  54.828015\n",
       "1     B5    A11  53.200717\n",
       "2    B26    A11  46.888787\n",
       "3     B0     A0  38.183026\n",
       "4    B18     A0  37.556255"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "e11dc50c",
   "metadata": {},
   "outputs": [],
   "source": [
    "source = df['Source'].values\n",
    "target = df['Target'].values\n",
    "weight_ls = df['weight'].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "489cde4e",
   "metadata": {},
   "outputs": [],
   "source": [
    "g = nx.Graph()\n",
    "for a in range(df.shape[0]):\n",
    "    organ1 = source[a]\n",
    "    organ2 = target[a]\n",
    "    weight = weight_ls[2]\n",
    "    g.add_edge(organ1,organ2,weight=weight)\n",
    "# g.add_edge('张彪','吴红',weight=weight)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "c6eccaab",
   "metadata": {},
   "outputs": [],
   "source": [
    "nx.write_pajek(g,r\"F:\\work\\2023.10.09DK链路预测\\2主题有向网络.net\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3e06cb99",
   "metadata": {},
   "source": [
    "### 2.1抽取已连接节点"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "3b0a20c7",
   "metadata": {},
   "outputs": [],
   "source": [
    "import random\n",
    "random.seed(2)\n",
    "from tqdm import tqdm\n",
    "import networkx as nx\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "44fafdd9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MultiGraph with 103 nodes and 465 edges\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\zhang\\AppData\\Local\\Temp\\ipykernel_19452\\3282102969.py:2: DeprecationWarning: info is deprecated and will be removed in version 3.0.\n",
      "\n",
      "  print(nx.info(G))\n"
     ]
    }
   ],
   "source": [
    "G = nx.read_pajek(r\"F:\\work\\2023.10.09DK链路预测\\2主题有向网络.net\")\n",
    "print(nx.info(G))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "ff77d048",
   "metadata": {},
   "outputs": [],
   "source": [
    "fbb = pd.read_csv(r'F:\\work\\2023.10.09DK链路预测\\1原始数据.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "476248c5",
   "metadata": {},
   "outputs": [],
   "source": [
    "fbb.columns = ['Node1','Node2','connect']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "5613253b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(465, 3)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Node1</th>\n",
       "      <th>Node2</th>\n",
       "      <th>connect</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>B20</td>\n",
       "      <td>A5</td>\n",
       "      <td>54.828015</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>B5</td>\n",
       "      <td>A11</td>\n",
       "      <td>53.200717</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>B26</td>\n",
       "      <td>A11</td>\n",
       "      <td>46.888787</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>B0</td>\n",
       "      <td>A0</td>\n",
       "      <td>38.183026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>B18</td>\n",
       "      <td>A0</td>\n",
       "      <td>37.556255</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Node1 Node2    connect\n",
       "0   B20    A5  54.828015\n",
       "1    B5   A11  53.200717\n",
       "2   B26   A11  46.888787\n",
       "3    B0    A0  38.183026\n",
       "4   B18    A0  37.556255"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "print(fbb.shape)\n",
    "fbb.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "a22e0028",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Node1</th>\n",
       "      <th>Node2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>B20</td>\n",
       "      <td>A5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>B5</td>\n",
       "      <td>A11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>B26</td>\n",
       "      <td>A11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>B0</td>\n",
       "      <td>A0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>B18</td>\n",
       "      <td>A0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Node1 Node2\n",
       "0   B20    A5\n",
       "1    B5   A11\n",
       "2   B26   A11\n",
       "3    B0    A0\n",
       "4   B18    A0"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fb = fbb.iloc[:,[0,1]]\n",
    "fb.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "0d20181f",
   "metadata": {},
   "outputs": [],
   "source": [
    "fb_temp = fb.copy()\n",
    "removable_edges_indices = []"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "4c5a81c4",
   "metadata": {},
   "outputs": [],
   "source": [
    "# number of connected components and nodes of G\n",
    "ncc = nx.number_connected_components(G)\n",
    "number_of_nodes = len(G.nodes)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "e5997ff3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "103"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "number_of_nodes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "3a1cabbf",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████████████████████████████████████████████████████████████████████████| 465/465 [00:00<00:00, 1672.82it/s]\n"
     ]
    }
   ],
   "source": [
    "# 对于每个节点对，我们将删除一个节点对并创建一个新的图，并检查连接组件的数量和节点的数量,与原始图形相同\n",
    "for i in tqdm(fb.index.values):\n",
    "    # 删除节点对并构建新图\n",
    "    G1 = nx.from_pandas_edgelist(fb_temp.drop(index= i), \"Node1\", \"Node2\",\n",
    "                                 create_using=nx.Graph())\n",
    "    # 如果连接组件的数量与原始组件的数量相同，图中我们不会删除边\n",
    "    if (nx.number_connected_components(G1) == ncc) and (len(G1.nodes) == number_of_nodes):\n",
    "        removable_edges_indices.append(i)\n",
    "         # 删除边，以便在下一次迭代中创建下一个G1，而不使用此边\n",
    "        fb_temp = fb_temp.drop(index = i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "2766bab3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0, 1, 2, 3, 4]"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "removable_edges_indices[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "4122466c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Node1</th>\n",
       "      <th>Node2</th>\n",
       "      <th>Connection</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>B20</td>\n",
       "      <td>A5</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>B5</td>\n",
       "      <td>A11</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>B26</td>\n",
       "      <td>A11</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>B0</td>\n",
       "      <td>A0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>B18</td>\n",
       "      <td>A0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Node1 Node2  Connection\n",
       "0   B20    A5           1\n",
       "1    B5   A11           1\n",
       "2   B26   A11           1\n",
       "3    B0    A0           1\n",
       "4   B18    A0           1"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 获取fb数据帧中的节点对，索引位于removable_Edge_Index中 \n",
    "df2 = fb.loc[removable_edges_indices]\n",
    " \n",
    "# 创建列“连接”，并指定默认值1（连接节点）\n",
    "df2['Connection'] = 1\n",
    " \n",
    "df2.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "ff73a638",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(363, 3)"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "f71c40b2",
   "metadata": {},
   "outputs": [],
   "source": [
    "df2.to_csv(r'F:\\work\\2023.10.09DK链路预测\\1已连接节点对_363.csv',index = False)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "86b68b1b",
   "metadata": {},
   "source": [
    "#### 2.2获取未连接节点"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "id": "198658ae",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(103, 103)\n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "matrix([[ 0.        , 46.88878696,  0.        , ...,  0.        ,\n",
       "          0.        ,  0.        ],\n",
       "        [46.88878696,  0.        , 46.88878696, ...,  0.        ,\n",
       "          0.        ,  0.        ],\n",
       "        [ 0.        , 46.88878696,  0.        , ...,  0.        ,\n",
       "          0.        ,  0.        ],\n",
       "        ...,\n",
       "        [ 0.        ,  0.        ,  0.        , ...,  0.        ,\n",
       "          0.        ,  0.        ],\n",
       "        [ 0.        ,  0.        ,  0.        , ...,  0.        ,\n",
       "          0.        ,  0.        ],\n",
       "        [ 0.        ,  0.        ,  0.        , ...,  0.        ,\n",
       "          0.        ,  0.        ]])"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# get a list of nodes in our graph\n",
    "l = list(G.nodes())\n",
    " \n",
    "# create adjacency matrix\n",
    "adj_G = nx.to_numpy_matrix(G, nodelist = l)\n",
    " \n",
    "print(str(adj_G.shape)+'\\n')\n",
    "adj_G"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "id": "d636c1f8",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|█████████████████████████████████████████████████████████████████████████████| 103/103 [00:00<00:00, 25724.27it/s]\n"
     ]
    }
   ],
   "source": [
    "# 获取所有没有边的节点对\n",
    "non_existing_edges = []\n",
    " \n",
    "# 遍历邻接矩阵\n",
    "offset = 0\n",
    "for i in tqdm(range(adj_G.shape[0])):\n",
    "    for j in range(offset,adj_G.shape[1]):\n",
    "        if i != j:\n",
    "            if adj_G[i,j] == 0:\n",
    "                non_existing_edges.extend([(l[i],l[j])])\n",
    "    offset = offset + 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "id": "30aa6046",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4788"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(non_existing_edges)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "id": "6d338543",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(4788, 3)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Node1</th>\n",
       "      <th>Node2</th>\n",
       "      <th>Connection</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>B20</td>\n",
       "      <td>B5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>B20</td>\n",
       "      <td>A11</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>B20</td>\n",
       "      <td>B26</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>B20</td>\n",
       "      <td>B0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>B20</td>\n",
       "      <td>B18</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Node1 Node2  Connection\n",
       "0   B20    B5           0\n",
       "1   B20   A11           0\n",
       "2   B20   B26           0\n",
       "3   B20    B0           0\n",
       "4   B20   B18           0"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Non_Existing_Edges 的数据框\n",
    "\n",
    "df1_ = pd.DataFrame(data = non_existing_edges, columns =['Node1', 'Node2'])\n",
    " \n",
    "# create a column 'Connection' with default 0 (no-connection)\n",
    "df1_['Connection'] = 0\n",
    "print(df1_.shape)\n",
    "df1_.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "id": "b212548b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Node1</th>\n",
       "      <th>Node2</th>\n",
       "      <th>Connection</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>B20</td>\n",
       "      <td>B5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>B20</td>\n",
       "      <td>A11</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>B20</td>\n",
       "      <td>B26</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>B20</td>\n",
       "      <td>B0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>B20</td>\n",
       "      <td>B18</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4783</th>\n",
       "      <td>I14</td>\n",
       "      <td>I11</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4784</th>\n",
       "      <td>I14</td>\n",
       "      <td>I30</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4785</th>\n",
       "      <td>I28</td>\n",
       "      <td>I11</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4786</th>\n",
       "      <td>I28</td>\n",
       "      <td>I30</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4787</th>\n",
       "      <td>I11</td>\n",
       "      <td>I30</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>4788 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Node1 Node2  Connection\n",
       "0      B20    B5           0\n",
       "1      B20   A11           0\n",
       "2      B20   B26           0\n",
       "3      B20    B0           0\n",
       "4      B20   B18           0\n",
       "...    ...   ...         ...\n",
       "4783   I14   I11           0\n",
       "4784   I14   I30           0\n",
       "4785   I28   I11           0\n",
       "4786   I28   I30           0\n",
       "4787   I11   I30           0\n",
       "\n",
       "[4788 rows x 3 columns]"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "id": "2f178aab",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 没有重复\n",
    "df1_.to_excel(r'F:\\work\\2023.10.09DK链路预测\\3未连接边.xlsx',index = False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "id": "ebac929a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4788, 3)"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1_.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "id": "73868681",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 筛选符合要求的未连接边\n",
    "# B-A-T-I\n",
    "idx_ls = []\n",
    "for i in range(df1_.shape[0]):\n",
    "    node1 = df1_['Node1'].values[i]\n",
    "    node2 = df1_['Node2'].values[i]\n",
    "    if (node1.startswith('B')) & (node2.startswith('A')):\n",
    "        idx_ls.append(i)\n",
    "    elif (node1.startswith('A')) & (node2.startswith('T')):\n",
    "        idx_ls.append(i)\n",
    "    elif (node1.startswith('T')) & (node2.startswith('I')):\n",
    "        idx_ls.append(i)\n",
    "    elif (node2.startswith('T')) & (node1.startswith('I')):\n",
    "        idx_ls.append(i)\n",
    "    elif (node2.startswith('T')) & (node1.startswith('I')):\n",
    "        idx_ls.append(i)\n",
    "    elif (node2.startswith('T')) & (node1.startswith('I')):\n",
    "        idx_ls.append(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "id": "bad74d52",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1465"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(idx_ls)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "id": "6b92988a",
   "metadata": {},
   "outputs": [],
   "source": [
    "need_df1 = df1_.iloc[idx_ls,:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "id": "1313e985",
   "metadata": {},
   "outputs": [],
   "source": [
    "need_df1.to_excel(r'F:\\work\\2023.10.09DK链路预测\\4带有前后顺序的未连接边.xlsx',index = False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "03a9b944",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2a8ad5e9",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ee62a302",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "id": "455df46c",
   "metadata": {},
   "outputs": [],
   "source": [
    "df1 = need_df1.sample(n = 363,replace = False, random_state = 521)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "id": "42a1ef3b",
   "metadata": {},
   "outputs": [],
   "source": [
    "df1.to_csv(r'F:\\work\\2023.10.09DK链路预测\\5未连接节点对_363.csv',index = False)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "df656bbe",
   "metadata": {},
   "source": [
    "#### 2.3子图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "id": "9fd3e757",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\zhang\\AppData\\Local\\Temp\\ipykernel_19452\\1424061280.py:1: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.\n",
      "  DF = df1.append(df2[['Node1', 'Node2', 'Connection']],\n"
     ]
    }
   ],
   "source": [
    "DF = df1.append(df2[['Node1', 'Node2', 'Connection']],\n",
    "                ignore_index=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "id": "e15572cc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(726, 3)"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DF.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "id": "d2d3d6cb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Node1</th>\n",
       "      <th>Node2</th>\n",
       "      <th>Connection</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>A10</td>\n",
       "      <td>T28</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>T0</td>\n",
       "      <td>I18</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>A11</td>\n",
       "      <td>T7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>A16</td>\n",
       "      <td>T3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>T25</td>\n",
       "      <td>I28</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Node1 Node2  Connection\n",
       "0   A10   T28           0\n",
       "1    T0   I18           0\n",
       "2   A11    T7           0\n",
       "3   A16    T3           0\n",
       "4   T25   I28           0"
      ]
     },
     "execution_count": 97,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "id": "269f0902",
   "metadata": {},
   "outputs": [],
   "source": [
    "DF.to_csv(r'F:\\work\\2023.10.09DK链路预测\\6正样本-负样本-726.csv',index = False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "id": "fc67bc78",
   "metadata": {},
   "outputs": [],
   "source": [
    "df3 = fb.drop(index=df2.index.values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "id": "f08d422a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(102, 2)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Node1</th>\n",
       "      <th>Node2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>B6</td>\n",
       "      <td>A21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>150</th>\n",
       "      <td>B12</td>\n",
       "      <td>A5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>176</th>\n",
       "      <td>B24</td>\n",
       "      <td>A22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>210</th>\n",
       "      <td>B20</td>\n",
       "      <td>A8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>212</th>\n",
       "      <td>B8</td>\n",
       "      <td>A19</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Node1 Node2\n",
       "10     B6   A21\n",
       "150   B12    A5\n",
       "176   B24   A22\n",
       "210   B20    A8\n",
       "212    B8   A19"
      ]
     },
     "execution_count": 101,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 从现有连接中删除了可以移动的边，可视为子图（以前可能存在的图）\n",
    "print(df3.shape)\n",
    "df3.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "id": "f382c7f0",
   "metadata": {},
   "outputs": [],
   "source": [
    "df3.to_csv(r'F:\\work\\2023.10.09DK链路预测\\7子图连边102.csv',index = False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "id": "f4da9df1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Graph with 103 nodes and 102 edges\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\zhang\\AppData\\Local\\Temp\\ipykernel_19452\\2290223665.py:5: DeprecationWarning: info is deprecated and will be removed in version 3.0.\n",
      "\n",
      "  print(nx.info(G_new))\n"
     ]
    }
   ],
   "source": [
    "# 仍然是103个点\n",
    "G_new = nx.from_pandas_edgelist(df3, \"Node1\", \"Node2\",\n",
    "                               create_using=nx.Graph())\n",
    "\n",
    "print(nx.info(G_new))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "id": "21f73516",
   "metadata": {},
   "outputs": [],
   "source": [
    "nx.write_pajek(G_new,r\"F:\\work\\2023.10.09DK链路预测\\8G_new.net\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5b0805bb",
   "metadata": {},
   "source": [
    "#### 2.4使用 Node2Vec 生成特征 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "id": "4118b012",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pickle"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "id": "c19f686a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "2a803ab6a836402abf538ff305afd200",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Computing transition probabilities:   0%|          | 0/103 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Generating walks (CPU: 1): 100%|██████████████████████████████████████████████████████| 50/50 [00:00<00:00, 271.73it/s]\n"
     ]
    }
   ],
   "source": [
    "from node2vec import Node2Vec\n",
    " \n",
    "# Generating walks\n",
    "node2vec = Node2Vec(G_new, dimensions=100, walk_length=16, num_walks=50)\n",
    " \n",
    "# training the node2vec model\n",
    "n2v_model = node2vec.fit(window=7, min_count=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "id": "1c99e90a",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(r'F:\\work\\2023.10.09DK链路预测\\9node2vec_model.pkl','wb') as f:\n",
    "    pickle.dump(n2v_model,f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "id": "93dd59d2",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 为df1的节点对(边)获取特征\n",
    "edge_features = [(n2v_model.wv[str(i)]+n2v_model.wv[str(j)]) for i,j in zip(DF['Node1'], DF['Node2'])]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "id": "f8d434bf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "726"
      ]
     },
     "execution_count": 113,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(edge_features)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "id": "b7d1fcc6",
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.concat([DF,pd.DataFrame(edge_features)],axis = 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "id": "d3ef8b8a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Node1</th>\n",
       "      <th>Node2</th>\n",
       "      <th>Connection</th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>...</th>\n",
       "      <th>90</th>\n",
       "      <th>91</th>\n",
       "      <th>92</th>\n",
       "      <th>93</th>\n",
       "      <th>94</th>\n",
       "      <th>95</th>\n",
       "      <th>96</th>\n",
       "      <th>97</th>\n",
       "      <th>98</th>\n",
       "      <th>99</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>A10</td>\n",
       "      <td>T28</td>\n",
       "      <td>0</td>\n",
       "      <td>-0.186827</td>\n",
       "      <td>-0.062615</td>\n",
       "      <td>-0.248560</td>\n",
       "      <td>-0.139477</td>\n",
       "      <td>0.099780</td>\n",
       "      <td>-1.067281</td>\n",
       "      <td>0.203121</td>\n",
       "      <td>...</td>\n",
       "      <td>0.980104</td>\n",
       "      <td>0.340763</td>\n",
       "      <td>-0.429992</td>\n",
       "      <td>0.189858</td>\n",
       "      <td>0.580862</td>\n",
       "      <td>0.263397</td>\n",
       "      <td>-0.320450</td>\n",
       "      <td>-0.475708</td>\n",
       "      <td>0.085325</td>\n",
       "      <td>-0.185802</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>T0</td>\n",
       "      <td>I18</td>\n",
       "      <td>0</td>\n",
       "      <td>0.728857</td>\n",
       "      <td>0.127417</td>\n",
       "      <td>-0.066941</td>\n",
       "      <td>0.372255</td>\n",
       "      <td>0.024145</td>\n",
       "      <td>-0.577889</td>\n",
       "      <td>-0.020375</td>\n",
       "      <td>...</td>\n",
       "      <td>0.526184</td>\n",
       "      <td>-0.517519</td>\n",
       "      <td>0.128812</td>\n",
       "      <td>0.311934</td>\n",
       "      <td>0.455693</td>\n",
       "      <td>0.125674</td>\n",
       "      <td>-0.683328</td>\n",
       "      <td>-0.638852</td>\n",
       "      <td>0.606663</td>\n",
       "      <td>0.509612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>A11</td>\n",
       "      <td>T7</td>\n",
       "      <td>0</td>\n",
       "      <td>0.045177</td>\n",
       "      <td>-0.336427</td>\n",
       "      <td>0.272866</td>\n",
       "      <td>-0.247121</td>\n",
       "      <td>0.438539</td>\n",
       "      <td>0.080785</td>\n",
       "      <td>0.587564</td>\n",
       "      <td>...</td>\n",
       "      <td>0.419084</td>\n",
       "      <td>0.140409</td>\n",
       "      <td>-0.020887</td>\n",
       "      <td>0.090129</td>\n",
       "      <td>0.148473</td>\n",
       "      <td>0.592331</td>\n",
       "      <td>1.130443</td>\n",
       "      <td>-0.181928</td>\n",
       "      <td>-0.294122</td>\n",
       "      <td>-0.339330</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>A16</td>\n",
       "      <td>T3</td>\n",
       "      <td>0</td>\n",
       "      <td>0.318691</td>\n",
       "      <td>-0.090859</td>\n",
       "      <td>-0.193941</td>\n",
       "      <td>0.261228</td>\n",
       "      <td>-0.154527</td>\n",
       "      <td>-1.208037</td>\n",
       "      <td>0.304543</td>\n",
       "      <td>...</td>\n",
       "      <td>0.352197</td>\n",
       "      <td>0.363573</td>\n",
       "      <td>0.130756</td>\n",
       "      <td>0.194689</td>\n",
       "      <td>0.261787</td>\n",
       "      <td>0.576575</td>\n",
       "      <td>0.338755</td>\n",
       "      <td>-0.314664</td>\n",
       "      <td>-0.245886</td>\n",
       "      <td>-0.783898</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>T25</td>\n",
       "      <td>I28</td>\n",
       "      <td>0</td>\n",
       "      <td>0.247096</td>\n",
       "      <td>0.274368</td>\n",
       "      <td>0.215654</td>\n",
       "      <td>0.043795</td>\n",
       "      <td>-0.116399</td>\n",
       "      <td>-1.027564</td>\n",
       "      <td>0.102875</td>\n",
       "      <td>...</td>\n",
       "      <td>0.644592</td>\n",
       "      <td>0.461145</td>\n",
       "      <td>-0.038677</td>\n",
       "      <td>0.161507</td>\n",
       "      <td>0.466097</td>\n",
       "      <td>0.049762</td>\n",
       "      <td>-0.413638</td>\n",
       "      <td>-0.647026</td>\n",
       "      <td>0.189952</td>\n",
       "      <td>0.187733</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>721</th>\n",
       "      <td>A25</td>\n",
       "      <td>T3</td>\n",
       "      <td>1</td>\n",
       "      <td>0.122566</td>\n",
       "      <td>0.598322</td>\n",
       "      <td>-0.073454</td>\n",
       "      <td>-0.199067</td>\n",
       "      <td>-0.082627</td>\n",
       "      <td>-1.013113</td>\n",
       "      <td>0.350259</td>\n",
       "      <td>...</td>\n",
       "      <td>0.736753</td>\n",
       "      <td>0.538536</td>\n",
       "      <td>0.008846</td>\n",
       "      <td>0.056007</td>\n",
       "      <td>0.755957</td>\n",
       "      <td>0.033186</td>\n",
       "      <td>-0.361905</td>\n",
       "      <td>-0.696876</td>\n",
       "      <td>0.204240</td>\n",
       "      <td>-0.462406</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>722</th>\n",
       "      <td>A17</td>\n",
       "      <td>T3</td>\n",
       "      <td>1</td>\n",
       "      <td>0.055422</td>\n",
       "      <td>0.147336</td>\n",
       "      <td>-0.183308</td>\n",
       "      <td>-0.015670</td>\n",
       "      <td>0.232562</td>\n",
       "      <td>-0.517838</td>\n",
       "      <td>0.460457</td>\n",
       "      <td>...</td>\n",
       "      <td>0.453653</td>\n",
       "      <td>0.258562</td>\n",
       "      <td>0.091772</td>\n",
       "      <td>0.294599</td>\n",
       "      <td>0.778072</td>\n",
       "      <td>0.462949</td>\n",
       "      <td>0.382925</td>\n",
       "      <td>-0.287464</td>\n",
       "      <td>-0.356753</td>\n",
       "      <td>-0.851457</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>723</th>\n",
       "      <td>A27</td>\n",
       "      <td>T32</td>\n",
       "      <td>1</td>\n",
       "      <td>-0.068134</td>\n",
       "      <td>-0.163828</td>\n",
       "      <td>0.237272</td>\n",
       "      <td>-0.281412</td>\n",
       "      <td>0.248673</td>\n",
       "      <td>-0.252800</td>\n",
       "      <td>0.368055</td>\n",
       "      <td>...</td>\n",
       "      <td>0.372032</td>\n",
       "      <td>0.335842</td>\n",
       "      <td>-0.099242</td>\n",
       "      <td>-0.017801</td>\n",
       "      <td>-0.110841</td>\n",
       "      <td>0.476523</td>\n",
       "      <td>0.999307</td>\n",
       "      <td>-0.102185</td>\n",
       "      <td>-0.282883</td>\n",
       "      <td>-0.353785</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>724</th>\n",
       "      <td>T11</td>\n",
       "      <td>I13</td>\n",
       "      <td>1</td>\n",
       "      <td>0.278887</td>\n",
       "      <td>0.096077</td>\n",
       "      <td>-0.004361</td>\n",
       "      <td>-0.027331</td>\n",
       "      <td>-0.275913</td>\n",
       "      <td>-0.642110</td>\n",
       "      <td>-0.327554</td>\n",
       "      <td>...</td>\n",
       "      <td>0.704994</td>\n",
       "      <td>-0.267654</td>\n",
       "      <td>0.243761</td>\n",
       "      <td>0.466885</td>\n",
       "      <td>0.227362</td>\n",
       "      <td>0.178092</td>\n",
       "      <td>-1.072843</td>\n",
       "      <td>-0.839390</td>\n",
       "      <td>0.137621</td>\n",
       "      <td>0.809282</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>725</th>\n",
       "      <td>T11</td>\n",
       "      <td>I12</td>\n",
       "      <td>1</td>\n",
       "      <td>-0.043347</td>\n",
       "      <td>-0.119634</td>\n",
       "      <td>-0.237188</td>\n",
       "      <td>0.108559</td>\n",
       "      <td>-0.134877</td>\n",
       "      <td>-0.612453</td>\n",
       "      <td>-0.093924</td>\n",
       "      <td>...</td>\n",
       "      <td>1.065235</td>\n",
       "      <td>-0.283960</td>\n",
       "      <td>0.062732</td>\n",
       "      <td>0.295728</td>\n",
       "      <td>0.406817</td>\n",
       "      <td>0.213310</td>\n",
       "      <td>-1.000484</td>\n",
       "      <td>-0.698134</td>\n",
       "      <td>0.081547</td>\n",
       "      <td>0.741036</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>726 rows × 103 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    Node1 Node2  Connection         0         1         2         3         4  \\\n",
       "0     A10   T28           0 -0.186827 -0.062615 -0.248560 -0.139477  0.099780   \n",
       "1      T0   I18           0  0.728857  0.127417 -0.066941  0.372255  0.024145   \n",
       "2     A11    T7           0  0.045177 -0.336427  0.272866 -0.247121  0.438539   \n",
       "3     A16    T3           0  0.318691 -0.090859 -0.193941  0.261228 -0.154527   \n",
       "4     T25   I28           0  0.247096  0.274368  0.215654  0.043795 -0.116399   \n",
       "..    ...   ...         ...       ...       ...       ...       ...       ...   \n",
       "721   A25    T3           1  0.122566  0.598322 -0.073454 -0.199067 -0.082627   \n",
       "722   A17    T3           1  0.055422  0.147336 -0.183308 -0.015670  0.232562   \n",
       "723   A27   T32           1 -0.068134 -0.163828  0.237272 -0.281412  0.248673   \n",
       "724   T11   I13           1  0.278887  0.096077 -0.004361 -0.027331 -0.275913   \n",
       "725   T11   I12           1 -0.043347 -0.119634 -0.237188  0.108559 -0.134877   \n",
       "\n",
       "            5         6  ...        90        91        92        93  \\\n",
       "0   -1.067281  0.203121  ...  0.980104  0.340763 -0.429992  0.189858   \n",
       "1   -0.577889 -0.020375  ...  0.526184 -0.517519  0.128812  0.311934   \n",
       "2    0.080785  0.587564  ...  0.419084  0.140409 -0.020887  0.090129   \n",
       "3   -1.208037  0.304543  ...  0.352197  0.363573  0.130756  0.194689   \n",
       "4   -1.027564  0.102875  ...  0.644592  0.461145 -0.038677  0.161507   \n",
       "..        ...       ...  ...       ...       ...       ...       ...   \n",
       "721 -1.013113  0.350259  ...  0.736753  0.538536  0.008846  0.056007   \n",
       "722 -0.517838  0.460457  ...  0.453653  0.258562  0.091772  0.294599   \n",
       "723 -0.252800  0.368055  ...  0.372032  0.335842 -0.099242 -0.017801   \n",
       "724 -0.642110 -0.327554  ...  0.704994 -0.267654  0.243761  0.466885   \n",
       "725 -0.612453 -0.093924  ...  1.065235 -0.283960  0.062732  0.295728   \n",
       "\n",
       "           94        95        96        97        98        99  \n",
       "0    0.580862  0.263397 -0.320450 -0.475708  0.085325 -0.185802  \n",
       "1    0.455693  0.125674 -0.683328 -0.638852  0.606663  0.509612  \n",
       "2    0.148473  0.592331  1.130443 -0.181928 -0.294122 -0.339330  \n",
       "3    0.261787  0.576575  0.338755 -0.314664 -0.245886 -0.783898  \n",
       "4    0.466097  0.049762 -0.413638 -0.647026  0.189952  0.187733  \n",
       "..        ...       ...       ...       ...       ...       ...  \n",
       "721  0.755957  0.033186 -0.361905 -0.696876  0.204240 -0.462406  \n",
       "722  0.778072  0.462949  0.382925 -0.287464 -0.356753 -0.851457  \n",
       "723 -0.110841  0.476523  0.999307 -0.102185 -0.282883 -0.353785  \n",
       "724  0.227362  0.178092 -1.072843 -0.839390  0.137621  0.809282  \n",
       "725  0.406817  0.213310 -1.000484 -0.698134  0.081547  0.741036  \n",
       "\n",
       "[726 rows x 103 columns]"
      ]
     },
     "execution_count": 115,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "id": "6f2f6228",
   "metadata": {},
   "outputs": [],
   "source": [
    "data.to_csv(r'F:\\work\\2023.10.09DK链路预测\\10类别—特征.csv',index = False)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "755dcf66",
   "metadata": {},
   "source": [
    "### 3.数据集划分"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "id": "02aef20e",
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.read_csv(r'F:\\work\\2023.10.09DK链路预测\\10类别—特征.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "id": "c4d3bf14",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(726, 103)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Node1</th>\n",
       "      <th>Node2</th>\n",
       "      <th>Connection</th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>...</th>\n",
       "      <th>90</th>\n",
       "      <th>91</th>\n",
       "      <th>92</th>\n",
       "      <th>93</th>\n",
       "      <th>94</th>\n",
       "      <th>95</th>\n",
       "      <th>96</th>\n",
       "      <th>97</th>\n",
       "      <th>98</th>\n",
       "      <th>99</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>A10</td>\n",
       "      <td>T28</td>\n",
       "      <td>0</td>\n",
       "      <td>-0.186827</td>\n",
       "      <td>-0.062615</td>\n",
       "      <td>-0.248560</td>\n",
       "      <td>-0.139477</td>\n",
       "      <td>0.099780</td>\n",
       "      <td>-1.067281</td>\n",
       "      <td>0.203121</td>\n",
       "      <td>...</td>\n",
       "      <td>0.980104</td>\n",
       "      <td>0.340763</td>\n",
       "      <td>-0.429992</td>\n",
       "      <td>0.189858</td>\n",
       "      <td>0.580862</td>\n",
       "      <td>0.263397</td>\n",
       "      <td>-0.320450</td>\n",
       "      <td>-0.475708</td>\n",
       "      <td>0.085325</td>\n",
       "      <td>-0.185802</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>T0</td>\n",
       "      <td>I18</td>\n",
       "      <td>0</td>\n",
       "      <td>0.728857</td>\n",
       "      <td>0.127417</td>\n",
       "      <td>-0.066941</td>\n",
       "      <td>0.372255</td>\n",
       "      <td>0.024145</td>\n",
       "      <td>-0.577889</td>\n",
       "      <td>-0.020375</td>\n",
       "      <td>...</td>\n",
       "      <td>0.526184</td>\n",
       "      <td>-0.517519</td>\n",
       "      <td>0.128812</td>\n",
       "      <td>0.311934</td>\n",
       "      <td>0.455693</td>\n",
       "      <td>0.125673</td>\n",
       "      <td>-0.683328</td>\n",
       "      <td>-0.638852</td>\n",
       "      <td>0.606663</td>\n",
       "      <td>0.509612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>A11</td>\n",
       "      <td>T7</td>\n",
       "      <td>0</td>\n",
       "      <td>0.045177</td>\n",
       "      <td>-0.336427</td>\n",
       "      <td>0.272866</td>\n",
       "      <td>-0.247121</td>\n",
       "      <td>0.438539</td>\n",
       "      <td>0.080785</td>\n",
       "      <td>0.587564</td>\n",
       "      <td>...</td>\n",
       "      <td>0.419084</td>\n",
       "      <td>0.140409</td>\n",
       "      <td>-0.020887</td>\n",
       "      <td>0.090129</td>\n",
       "      <td>0.148473</td>\n",
       "      <td>0.592331</td>\n",
       "      <td>1.130443</td>\n",
       "      <td>-0.181928</td>\n",
       "      <td>-0.294122</td>\n",
       "      <td>-0.339330</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>A16</td>\n",
       "      <td>T3</td>\n",
       "      <td>0</td>\n",
       "      <td>0.318691</td>\n",
       "      <td>-0.090859</td>\n",
       "      <td>-0.193941</td>\n",
       "      <td>0.261228</td>\n",
       "      <td>-0.154527</td>\n",
       "      <td>-1.208036</td>\n",
       "      <td>0.304543</td>\n",
       "      <td>...</td>\n",
       "      <td>0.352197</td>\n",
       "      <td>0.363573</td>\n",
       "      <td>0.130756</td>\n",
       "      <td>0.194689</td>\n",
       "      <td>0.261787</td>\n",
       "      <td>0.576575</td>\n",
       "      <td>0.338755</td>\n",
       "      <td>-0.314664</td>\n",
       "      <td>-0.245886</td>\n",
       "      <td>-0.783898</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>T25</td>\n",
       "      <td>I28</td>\n",
       "      <td>0</td>\n",
       "      <td>0.247096</td>\n",
       "      <td>0.274368</td>\n",
       "      <td>0.215654</td>\n",
       "      <td>0.043795</td>\n",
       "      <td>-0.116399</td>\n",
       "      <td>-1.027564</td>\n",
       "      <td>0.102875</td>\n",
       "      <td>...</td>\n",
       "      <td>0.644591</td>\n",
       "      <td>0.461145</td>\n",
       "      <td>-0.038677</td>\n",
       "      <td>0.161507</td>\n",
       "      <td>0.466097</td>\n",
       "      <td>0.049762</td>\n",
       "      <td>-0.413638</td>\n",
       "      <td>-0.647026</td>\n",
       "      <td>0.189952</td>\n",
       "      <td>0.187733</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 103 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "  Node1 Node2  Connection         0         1         2         3         4  \\\n",
       "0   A10   T28           0 -0.186827 -0.062615 -0.248560 -0.139477  0.099780   \n",
       "1    T0   I18           0  0.728857  0.127417 -0.066941  0.372255  0.024145   \n",
       "2   A11    T7           0  0.045177 -0.336427  0.272866 -0.247121  0.438539   \n",
       "3   A16    T3           0  0.318691 -0.090859 -0.193941  0.261228 -0.154527   \n",
       "4   T25   I28           0  0.247096  0.274368  0.215654  0.043795 -0.116399   \n",
       "\n",
       "          5         6  ...        90        91        92        93        94  \\\n",
       "0 -1.067281  0.203121  ...  0.980104  0.340763 -0.429992  0.189858  0.580862   \n",
       "1 -0.577889 -0.020375  ...  0.526184 -0.517519  0.128812  0.311934  0.455693   \n",
       "2  0.080785  0.587564  ...  0.419084  0.140409 -0.020887  0.090129  0.148473   \n",
       "3 -1.208036  0.304543  ...  0.352197  0.363573  0.130756  0.194689  0.261787   \n",
       "4 -1.027564  0.102875  ...  0.644591  0.461145 -0.038677  0.161507  0.466097   \n",
       "\n",
       "         95        96        97        98        99  \n",
       "0  0.263397 -0.320450 -0.475708  0.085325 -0.185802  \n",
       "1  0.125673 -0.683328 -0.638852  0.606663  0.509612  \n",
       "2  0.592331  1.130443 -0.181928 -0.294122 -0.339330  \n",
       "3  0.576575  0.338755 -0.314664 -0.245886 -0.783898  \n",
       "4  0.049762 -0.413638 -0.647026  0.189952  0.187733  \n",
       "\n",
       "[5 rows x 103 columns]"
      ]
     },
     "execution_count": 122,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "print(data.shape)\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "id": "72ccdfbb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "508.2"
      ]
     },
     "execution_count": 123,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "726*0.7"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "id": "eb8ec8c2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    256\n",
       "1    252\n",
       "Name: Connection, dtype: int64"
      ]
     },
     "execution_count": 124,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train = data.sample(n=508,random_state=1)\n",
    "train['Connection'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "id": "b031379f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "218"
      ]
     },
     "execution_count": 125,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "726-508"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "id": "013d1199",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1    111\n",
       "0    107\n",
       "Name: Connection, dtype: int64"
      ]
     },
     "execution_count": 127,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test = data.drop(index=train.index)\n",
    "test['Connection'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "id": "afe87777",
   "metadata": {},
   "outputs": [],
   "source": [
    "train.to_csv(r'F:\\work\\2023.10.09DK链路预测\\11train_508.csv',index = False)\n",
    "test.to_csv(r'F:\\work\\2023.10.09DK链路预测\\11test_218.csv',index = False)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3de98802",
   "metadata": {},
   "source": [
    "### 4.构建分类模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 136,
   "id": "838c9861",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "from sklearn.metrics import confusion_matrix\n",
    "from sklearn.metrics import precision_recall_fscore_support\n",
    "from sklearn.model_selection import cross_val_score\n",
    "import numpy as np\n",
    "from tqdm import tqdm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 130,
   "id": "12f33e02",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "train = pd.read_csv(r'F:\\work\\2023.10.09DK链路预测\\11train_508.csv')\n",
    "val = pd.read_csv(r'F:\\work\\2023.10.09DK链路预测\\11test_218.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 131,
   "id": "1fd5c137",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['Node1', 'Node2', 'Connection', '0', '1', '2', '3', '4', '5', '6',\n",
       "       ...\n",
       "       '90', '91', '92', '93', '94', '95', '96', '97', '98', '99'],\n",
       "      dtype='object', length=103)"
      ]
     },
     "execution_count": 131,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 132,
   "id": "e7009350",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import LabelEncoder\n",
    "labelEncoder = LabelEncoder()\n",
    "\n",
    "train_y = labelEncoder.fit_transform(train['Connection'])\n",
    "val_y = labelEncoder.fit_transform(val['Connection'])\n",
    "# test_y = labelEncoder.fit_transform(test['影响力类别3'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "id": "d4cd35f8",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 原始特征-标签\n",
    "train_X = train.iloc[:,3:]\n",
    "val_X = val.iloc[:,3:]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3932afbc",
   "metadata": {},
   "source": [
    "#### 4.1直接采用SVM建模"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "id": "3c235405",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.svm import SVC \n",
    "kernel_list = ['linear', 'poly', 'rbf', 'sigmoid']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 143,
   "id": "79850461",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00,  7.97it/s]\n"
     ]
    }
   ],
   "source": [
    "# 10折交叉验证  kernel\n",
    "train_score_ls = []\n",
    "val_score_ls = []\n",
    "\n",
    "for kernel in tqdm(kernel_list):\n",
    "    model = SVC(kernel=kernel, probability=True,random_state=0)\n",
    "    model_s = cross_val_score(model,train_X,train_y,cv=5)\n",
    "    train_score_ls.append(np.mean(model_s))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 144,
   "id": "e47e1ced",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjEAAAGdCAYAAADjWSL8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy88F64QAAAACXBIWXMAAA9hAAAPYQGoP6dpAABIXElEQVR4nO3deVhU9eIG8PfMwDDsyDaiIrgL4grigqYVWloqWq4JIlpZWpm3rterttg1f/e2qFlaGoi2qeWS3asVtpiCiiKYCYooCuqwqqzCwMz5/WFNjaAyCJxZ3s/znOe5nHPm8I53HubtnPP9HkEURRFEREREZkYmdQAiIiKixmCJISIiIrPEEkNERERmiSWGiIiIzBJLDBEREZkllhgiIiIySywxREREZJZYYoiIiMgs2UgdoKnodDpcuXIFzs7OEARB6jhERETUAKIooqysDG3atIFMZty5FYspMVeuXIGvr6/UMYiIiKgRcnNz0a5dO6NeYzElxtnZGcDNfwQXFxeJ0xAREVFDlJaWwtfXV/89bgyLKTF/XEJycXFhiSEiIjIzjbkVhDf2EhERkVliiSEiIiKzxBJDREREZsli7okhIiJqDqIoora2FlqtVuooZkkul8PGxqZZpj9hiSEiIroNjUYDtVqNyspKqaOYNQcHB/j4+EChUDTpcVliiIiI6qHT6ZCdnQ25XI42bdpAoVBwMlUjiaIIjUaDwsJCZGdno0uXLkZPaHcnLDFERET10Gg00Ol08PX1hYODg9RxzJa9vT1sbW1x8eJFaDQaKJXKJjs2b+wlIiK6g6Y8c2CtmuvfkP/PEBERkVliiSEiIiKzxBJDREREt+Xv749Vq1ZJHaNevLGXiIjIwgwfPhx9+vRpkvJx9OhRODo63nuoZsAzMXeRmFWEmPijqKrhJEdERGQZ/pjAryG8vLxMdnQWS8wdVGpq8fwXqfjxdAHmb0mDVidKHYmIiCQkiiIqNbWSLKLYsO+g6Oho7N+/H6tXr4YgCBAEAfHx8RAEAd999x1CQkJgZ2eHAwcO4Ny5cxg3bhxU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o2SSg3NxcLFizAmTNn8MUXX2DNmjV44YUX0KVLF4wbNw5PPvkkDh48qL/xsm3bthg3btxtjxcQEICBAwdi4cKFmDp1Kuzt7Vvw3ZC5+fLLLxEXF4fMzEy8+uqrSE5Oxrx586SORS3gyJEjePPNN3Hs2DHk5ORgx44dKCwsrPMfSc7OzpgxYwZefvll/PTTTzh16hRiYmIgk8nu+azd3/72N/zwww944403kJmZiU2bNuH999+/7U3k4eHh6NatG6KionDixAkcOHAAixcvNvr3ssTcRps2bZCYmAitVouHHnoIQUFBeOGFF+Dq6gqZTAaZTIYtW7YgJSUFQUFBePHFF/HWW29JHZskFBUVhRs3biA0NBRz587Fc889h6eeegrAzZFFwcHBePTRRzFo0CCIoog9e/bcdc6gWbNmQaPR8FIS3dXrr7+OLVu2oFevXti0aRM+++wzBAYGSh2LWoCLiwt++eUXjB49Gl27dsWSJUvwzjvvYNSoUXX2fffddzFo0CA8+uijCA8PR1hYGAICAqBUKu8pQ79+/bBt2zZs2bIFQUFBeOWVV7Bs2TJER0fXu79MJsPOnTtRXV2N0NBQzJ49G8uXLzf69wrinS5aEVGDDB8+HH369GnyR1ssX74cW7ZswcmTJ5v0uEREwM2pQtq2bYt33nkHs2bNkjqO0axmxl4ic1JeXo6MjAysWbMGb7zxhtRxiMhCpKam4vTp0wgNDUVJSQmWLVsGAHe8tG3KeDmJyATNmzcPQ4YMwbBhw3gpiYia1Ntvv43evXvrZ/U9cOAAPD09pY7VKLycRERERGaJZ2KIiIjILLHEEBERkVliiSEiIiKzxBJDREREZoklhoiIiMwSSwwRERGZJZYYIiIiMkssMURERGSWWGKIiIjILP0/B7YQa/2UwWoAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(kernel_list,train_score_ls,label = 'train') # 训练\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 145,
   "id": "750ec7d3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.7522935779816514"
      ]
     },
     "execution_count": 145,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 参数确定，计算acc\n",
    "model = SVC(kernel='linear', probability=True,random_state=0)\n",
    "\n",
    "model.fit(train_X,train_y) \n",
    "score_r = model.score(val_X,val_y)\n",
    "score_r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 152,
   "id": "f1a855ca",
   "metadata": {},
   "outputs": [],
   "source": [
    "p, r, f1, s = precision_recall_fscore_support(val_y.reshape(-1, 1), model.predict(val_X))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 156,
   "id": "61db2518",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>P</th>\n",
       "      <th>r</th>\n",
       "      <th>f1</th>\n",
       "      <th>S</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.791209</td>\n",
       "      <td>0.672897</td>\n",
       "      <td>0.727273</td>\n",
       "      <td>107</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.724409</td>\n",
       "      <td>0.828829</td>\n",
       "      <td>0.773109</td>\n",
       "      <td>111</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          P         r        f1    S\n",
       "0  0.791209  0.672897  0.727273  107\n",
       "1  0.724409  0.828829  0.773109  111"
      ]
     },
     "execution_count": 156,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.DataFrame({'P':p, 'r':r, 'f1':f1, 'S':s})"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "156b3ac8",
   "metadata": {},
   "source": [
    "#### 4.2预测特征获取"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 157,
   "id": "a873af0b",
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.read_excel(r'F:\\work\\2023.10.09DK链路预测\\4带有前后顺序的未连接边.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 158,
   "id": "30608c88",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1465, 3)"
      ]
     },
     "execution_count": 158,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 161,
   "id": "9c779172",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Node1</th>\n",
       "      <th>Node2</th>\n",
       "      <th>Connection</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>B20</td>\n",
       "      <td>A11</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>B20</td>\n",
       "      <td>A17</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>B20</td>\n",
       "      <td>A18</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>B20</td>\n",
       "      <td>A16</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>B20</td>\n",
       "      <td>A19</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Node1 Node2  Connection\n",
       "0   B20   A11           0\n",
       "1   B20   A17           0\n",
       "2   B20   A18           0\n",
       "3   B20   A16           0\n",
       "4   B20   A19           0"
      ]
     },
     "execution_count": 161,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 162,
   "id": "06df840f",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(r'F:\\work\\2023.10.09DK链路预测\\9node2vec_model.pkl','rb') as f:\n",
    "    n2v_model = pickle.load(f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 163,
   "id": "439713ef",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 为data的节点对(边)获取特征\n",
    "edge_features = [(n2v_model.wv[str(i)]+n2v_model.wv[str(j)]) for i,j in zip(data['Node1'], data['Node2'])]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 164,
   "id": "8bd6c166",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.concat([data,pd.DataFrame(edge_features)],axis = 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 165,
   "id": "8a1264dc",
   "metadata": {},
   "outputs": [],
   "source": [
    "# df.to_excel(r'F:\\work\\2023.10.09DK链路预测\\12预测集.xlsx',index = False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 166,
   "id": "d347f51a",
   "metadata": {},
   "outputs": [],
   "source": [
    "pre_X = df.iloc[:,3:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 167,
   "id": "162b432a",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\anoconda3\\lib\\site-packages\\sklearn\\base.py:420: UserWarning: X does not have valid feature names, but SVC was fitted with feature names\n",
      "  warnings.warn(\n"
     ]
    }
   ],
   "source": [
    "predict_pro = model.predict_proba(pre_X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 168,
   "id": "e604f70b",
   "metadata": {},
   "outputs": [],
   "source": [
    "predict_pro_1 = [i[1] for i in predict_pro]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 169,
   "id": "c44bf6e5",
   "metadata": {},
   "outputs": [],
   "source": [
    "pre_data = pd.concat([data.iloc[:,:2], pd.DataFrame(predict_pro_1,columns=['链接概率'])],axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 174,
   "id": "c6fce0f7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Node1</th>\n",
       "      <th>Node2</th>\n",
       "      <th>链接概率</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>B20</td>\n",
       "      <td>A11</td>\n",
       "      <td>0.554666</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>B20</td>\n",
       "      <td>A17</td>\n",
       "      <td>0.661209</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>B20</td>\n",
       "      <td>A18</td>\n",
       "      <td>0.604299</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>B20</td>\n",
       "      <td>A16</td>\n",
       "      <td>0.609205</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>B20</td>\n",
       "      <td>A19</td>\n",
       "      <td>0.606341</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Node1 Node2      链接概率\n",
       "0   B20   A11  0.554666\n",
       "1   B20   A17  0.661209\n",
       "2   B20   A18  0.604299\n",
       "3   B20   A16  0.609205\n",
       "4   B20   A19  0.606341"
      ]
     },
     "execution_count": 174,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pre_data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 173,
   "id": "e2686c06",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(471, 3)"
      ]
     },
     "execution_count": 173,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pre_data[pre_data['链接概率']>0.5].shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 175,
   "id": "e74cab0e",
   "metadata": {},
   "outputs": [],
   "source": [
    "pre_data.to_excel(r'F:\\work\\2023.10.09DK链路预测\\13预测结果.xlsx',index = False)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a112f9db",
   "metadata": {},
   "source": [
    "## 最后手动整理列表"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
